import axios from 'axios'
import React, { useEffect, useState } from 'react'
import { Image, List } from 'antd-mobile'

export default function ComingSoon() {
    const [list, setList] = useState([])
    useEffect(() => {
        axios({
            url: 'https://m.maizuo.com/gateway?cityId=110100&pageNum=1&pageSize=10&type=2&k=2515944',
            headers: {
                'X-Client-Info': '{"a":"3000","ch":"1002","v":"5.2.1","e":"16812175742925156196417537","bc":"110100"}',
                'X-Host': 'mall.film-ticket.film.list'
            }
        }).then(res => {
            setList(res.data.data.films)
        })
    }, [])
    return (
        <div>
            <List>
                {list.map(item => (
                    <List.Item
                        key={item.filmId}
                        prefix={
                            <Image
                                src={item.poster}
                                width={60}
                                height={60}
                            />
                        }
                        description={<div>{item.category} | {item.runtime} 分钟</div>}
                    >
                        {item.name}
                    </List.Item>
                ))}
            </List>
        </div>
    )
}
